const interfaces = require("../../utils/urlconfig")
Page({

  /** 页面的初始数据
   */
  data: {
    swipers:[
      "/images/banner/airpods.png",
      "/images/banner/alexa.png",
      "/images/banner/camera.png",
      "/images/banner/mouse.png",
      "/images/banner/phone.png",
      "/images/banner/playstation.png"
    ],
    logos:[
      {image:"/images/logos/Angular.png", text:"Angular"},
      {image:"/images/logos/CSS3.png",text:"CSS3"},
      {image:"/images/logos/Flutter.png",text:"Flutter"},
      {image:"/images/logos/HTML5.png",text:"HTML5"},
      {image:"/images/logos/JavaScript.png",text:"JavaScript"},
      {image:"/images/logos/JSON.png",text:"JSON"},
      {image:"/images/logos/Node.png",text:"Node"},
      {image:"/images/logos/React.png",text:"React"},
      // {image:"/images/logos/router.png",text:"router"},
      {image:"/images/logos/Vue.png",text:"Vue.js"},
      {image: "/images/logos/wxxcx.png",text:"wxxcx"},
      // {image: "/images/logos/xcx.png",text:"xcx"}
    ],
    
    quicks:[
      {image:"/images/banner/airpods.png", price:"$10"},
      {image:"/images/banner/alexa.png",price:"$123"},
      {image:"/images/banner/camera.png",price:"$100"},
      {image:"/images/banner/mouse.png",price:"$100"},
      {image:"/images/banner/playstation.png",price:"$190"},
    ],
    pageRow:[
      ["/images/banner/airpods.png",
      "/images/banner/alexa.png",
      "/images/banner/camera.png",
      "/images/banner/mouse.png",],
      ["/images/banner/phone.png",
      "/images/banner/playstation.png"]
  ],
    indicatorDots: true,
    vertical: false,
    autoplay: true,
    interval: 3000,
    duration: 500
  },

  /**生命周期函数--监听页面加载
   */
  onLoad: function (options) {

    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: interfaces.homepage,
      header:{
        'content-type':'application/json'
      },
      success(res){
        wx.hideLoading()
        // self.setData({
        //   swipers:res.data.swipers,
        //   logos:res.data.logos,
        //   quicks:res.data.quicks,
        //   pageRow:res.data.pageRow
        // })
        //console.log(self.data.swipers)
      }
    })
  }

})